package ua.org.extjsbuilder.parser.runtime.instructions;

import java.io.IOException;
import java.io.Writer;
import java.util.List;

import ua.org.extjsbuilder.parser.IInstruction;
import ua.org.extjsbuilder.parser.IScope;
import ua.org.extjsbuilder.parser.JSObject;

public class TryCatchFinally implements IInstruction {
	private List<IInstruction> tryBlock;
	private List<IInstruction> catchBlock;
	private List<IInstruction> finallyBlock;
	private String errorName;

	public TryCatchFinally(List<IInstruction> tryBlock,
			List<IInstruction> catchBlock, String errorName, 
			List<IInstruction> finallyBlock) {
		this.tryBlock = tryBlock;
		this.catchBlock = catchBlock;
		this.finallyBlock = finallyBlock;
		this.errorName = errorName;
	}

	public void compile(Writer out, boolean optimize) throws IOException {
		// TODO Auto-generated method stub
		
	}

	public JSObject execute(IScope scope, JSObject[] args) {
		// TODO Auto-generated method stub
		return null;
	}

	public String getName() {
		return "try";
	}

	public List<IInstruction> getTryBlock() {
		return tryBlock;
	}

	public List<IInstruction> getCatchBlock() {
		return catchBlock;
	}

	public List<IInstruction> getFinallyBlock() {
		return finallyBlock;
	}

	public String getErrorName() {
		return errorName;
	}
}
